package com.zues.thread.design_mode.guarded_stop;

import lombok.extern.slf4j.Slf4j;

/**
 * 居民类
 */
@Slf4j(topic = "c.People")
public class People extends Thread{

    @Override
    public void run() {
        //收信
        GuardedObject guardedObject = MailBoxes.createGuardedObject();
        log.debug("开始收信 id: {}",guardedObject.getId());
        Object mail = guardedObject.get(5000);
        log.debug("收到信 id: {}, 内容：{}",guardedObject.getId(),mail);
    }
}
